<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>

    <script>
      function testFoucs() {
        console.log("获得焦点了");
      }
      function testBlur() {
        console.log("失去焦点了");
      }
      function testChange(value) {
        console.log("内容改变为" + value);
      }
      function testChange2(value) {
        console.log("选项改变为" + value)
      }
      function testSubmit() {
        var flag = confirm("确认要提交吗？");
        if (!flag) {
            return false;
        }
        return true;
      }
    </script>
  </head>
  <body>
    <form action="JS引入方式.html" method="get" onsubmit="return testSubmit()">
      用户昵称：<input type="text" name="realName"
         onfocus="testFoucs()"
         onblur="testBlur()"
         onchange="testChange(this.value)"   
    > <br />
      登录账号：<input type="text" name="logoinName" /><br />
      选择籍贯：
            <select onchange="testChange2(this.value)">
                <option>北京</option>
                <option>山西</option>
                <option>上海</option>
            </select>
            
        <br>
      <input type="submit" value="注册" />
      <input type="reset" value="清空" />
    </form>
  </body>
</html>
